import { defHttp } from "@/utils/http";

// ERP 主要原因 VO
export interface BidReasonVO {
	id: number; // 主键
	name: string; // 名称
	parentId: number; // 父级ID
	sqNumb: number; // 序号
}

// ERP 主要原因 API
export const BidReasonApi = {
	// 查询主要原因分页
	getBidReasonPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/reason/page`, params });
	},

	// 查询主要原因详情
	getBidReason: async (id: number) => {
		return await defHttp.get({ url: `/whs/reason/get?id=` + id });
	},

	// 新增主要原因
	createBidReason: async (data: BidReasonVO) => {
		return await defHttp.post({ url: `/whs/reason/create`, data });
	},

	// 修改主要原因
	updateBidReason: async (data: BidReasonVO) => {
		return await defHttp.put({ url: `/whs/reason/update`, data });
	},

	// 删除主要原因
	deleteBidReason: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/reason/delete?id=` + id
		});
	},

	// 导出主要原因 Excel
	exportBidReason: async (params: any) => {
		return await defHttp.download({ url: `/whs/reason/export-excel`, params });
	}
};
